import request from '@/utils/request'

// 创建保养标准
export function createMaintainStandard(data) {
  return request({
    url: '/ems/maintain-standard/create',
    method: 'post',
    data: data
  })
}

// 更新保养标准
export function updateMaintainStandard(data) {
  return request({
    url: '/ems/maintain-standard/update',
    method: 'put',
    data: data
  })
}

// 删除保养标准
export function deleteMaintainStandard(id) {
  return request({
    url: '/ems/maintain-standard/delete?id=' + id,
    method: 'delete'
  })
}

// 获得保养标准
export function getMaintainStandard(id) {
  return request({
    url: '/ems/maintain-standard/get?id=' + id,
    method: 'get'
  })
}

// 获得保养标准分页
export function getMaintainStandardPage(query) {
  return request({
    url: '/ems/maintain-standard/page',
    method: 'get',
    params: query
  })
}

// 导出保养标准 Excel
export function exportMaintainStandardExcel(query) {
  return request({
    url: '/ems/maintain-standard/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}


// 删除入库信息
export function deleteInfo(id) {
  return request({
    url: '/ems/maintain-standard/deleteInfo?id=' + id,
    method: 'delete'
  })
}

// 更新入库信息
export function updateInfo(data) {
  return request({
    url: '/ems/maintain-standard/updateInfo',
    method: 'put',
    data: data
  })
}

// 获取精简信息列表
export function listSimpleMaintainStandards() {
  return request({
    url: 'ems/maintain-standard/list-all-simple',
    method: 'get'
  })
}